﻿@using CQIE.OVS.Model
@model IList<CQIE.OVS.Model.Campaigner>

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>GetResult</title>
    <link href="~/kj/layui/css/layui.css" rel="stylesheet" />
    <style type="text/css">
        div {
            /* border: #000000 solid 1px; */
        }

        .onediv {
            width: 600px;
            margin-left: 90px;
            height: 100px;
        }

        .d1 {
            width: 100%;
            height: 50px;
            margin-bottom: 15px;
        }

        #jdt, .CNum, .Cname {
            float: left;
            height: 100%;
            line-height: 50px;
        }

        #jdt {
            height: 70%;
            width: 60%;
            padding-top: 15px;
        }

        .Cname {
            width: 17%;
            font-size: 13px;
        }

        .CNum {
            width: 19%;
            margin-left: 5px;
        }
    </style>
    <script src="~/kj/layui/layui.js"></script>
</head>
<body>
<div style="width: 800px">
    @{
        <input type="hidden" name="active" value="@ViewBag.Active"/>
        foreach (Campaigner item in Model)
        {
            <div id="" class="onediv">
                <div class="d1">
                    <div class="Cname"><span>姓名：@item.Name</span></div>
                    <div id="jdt">
                        <div class="layui-progress layui-progress-big" lay-filter="@item.ID">
                            <div class="layui-progress-bar layui-bg-blue"></div>
                        </div>
                    </div>
                    <div class="CNum"><span>票数：@item.Num</span></div>
                    <script>
                        layui.use(['element'],
                            function() {
                                var element = layui.element;
                                var table = layui, table;
                                var $ = layui.jquery;

                                $.post('/Active/CountHot',
                                    { Cid: @item.ID },
                                    function(msg) {
                                        console.log(msg);
                                        element.progress(msg.ID, msg.Hot);
                                        
                                    });

                            });
                    </script>
                </div>
            </div>
        }
    }
</div>
    
<div style="width: 406px; margin-left: 170px;">
    <table id="tableCam" lay-filter="test"></table>
</div>




<script>
    layui.use(['element','table','jquery'],function(){
        var element = layui.element;
        var table = layui.table;
        var $ = layui.jquery;

        table.render({
            elem: '#tableCam'
            ,height: 312
            , url: '/Active/GetCamTable' //数据接口
            , where: {AID:$('[name=active]').val()}
            , page: true //开启分页
            , cols: [[ //表头
                {type: 'numbers', title: '排名',align: 'center', width:80}
                ,{field: 'Name', title: '姓名', width:80 ,align: 'center'}
                ,{field: 'Sex', title: '性别', width:80,align: 'center'} 
                ,{field: 'Num', title: '票数', width: 157,align: 'center'}
            ]]
            , parseData: function(res) {
                return {
                    "code": res.status,
                    "msg": res.message,
                    "count": res.total,
                    "data": res.data
                };
            }
        });
				
    });
</script>
</body>
</html>
